|
![](/i/fill.gif) |
Yes, I got it. Thank you very much. But I do not know why "box.pov" is
not a scene with reflection. I do see it. Why can I see it? The data for
displaying is what I want to get. Is it called light internsity?
Actually, the code I post is the only code I wrote till now. I only want
to test if the reflect() function is called when I rend some pov file. Thank
you for your advice.
Best Regard
Wu Yang
"Christopher James Huff" <chr### [at] mac com> wrote in message
news:chr### [at] netplex aussie org...
> In article <3daa404f@news.povray.org>, "Wu Yang" <wya### [at] cs wright edu>
> wrote:
>
> > Is "box.pov" a scene with reflection.
>
> No. It doesn't use reflection anywhere, which would be one reason no
> files are written. Actually looking at the scene might have helped... ;-)
> I'd suggest you use one of the demo scenes in scenes/textures/finishes/,
> all of which do use reflection. And watch out, it could produce a huge
> amount of data. I don't know what you want it for, it might be best to
> make a very simple scene with one reflective shape to minimize the
> amount of reflection data.
>
>
> > I do render it, but the reflect()
> > function is not called because I define an "ofstream" object "output" in
> > reflect() function. The exact code is "ofstream
output("C:\\out.dat");".And
> > then render "box.pov",however, no "out.dat" formed. What's wrong?
>
> > static void Reflect(......)
> > {
> > ofstream output("D:\\out.dat");
>
> First, you are opening the file for every reflected ray. This will be
> very slow, it would be better to open it once, for a temporary hack like
> this it would be easiest to just use a global variable. Also, you are
> opening it in write mode, it will overwrite the previously written data
> every time, so you will never get a file with more than one entry. You
> need to either open it once or open it in append mode. Opening the file
> once in write mode and using a global variable for it would be the best
> way: it will be much faster, and if you use append mode you will have to
> remember to delete the data file before each render or it will just
> append to what it wrote in previous renders.
>
> And finally, you didn't give all the code. This is just the code for
> opening a file, you didn't say how you are writing the data.
>
> --
> Christopher James Huff <cja### [at] earthlink net>
> http://home.earthlink.net/~cjameshuff/
> POV-Ray TAG: chr### [at] tag povray org
> http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |